Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(MenuItem): allow observing submenu content resize when a re-render isn't triggered #2713

Conversation

YossiSaadi
Copy link
Contributor

@YossiSaadi YossiSaadi commented Jan 13, 2025

@YossiSaadi YossiSaadi requested a review from a team as a code owner January 13, 2025 10:13
Copy link
Contributor

A new prerelease version of this PR has been published! 🎉
To install this prerelease version, run the following command in your terminal with any one of the packages changed in this PR:

To update @vibe/core:

yarn add @vibe/[email protected]

Or with npm:

npm i @vibe/[email protected]

To update @vibe/icons:

yarn add @vibe/[email protected]

Or with npm:

npm i @vibe/[email protected]

Comment on lines 59 to 66
/**
* Enables the observation of content resize for the menu item's submenu.
* When set to `true`, a ResizeObserver is attached to the popper content,
* automatically triggering repositioning when the size of the submenu's content changes.
*
* This is useful for when submenu's content may grow or shrink without a re-render being triggered.
*/
observeSubMenuContentResize?: boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the implementation details really matter here? I think we can simplify it and just say that it will respond to resizing of the content
Also worth renaming prop name IMO, maybe autoAdjustSubMenuOnResize?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

autoAdjustOnSubMenuContentResize?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good

Copy link
Member

@talkor talkor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Just one comment about naming

Copy link
Contributor

A new prerelease version of this PR has been published! 🎉
To install this prerelease version, run the following command in your terminal with any one of the packages changed in this PR:

To update @vibe/core:

yarn add @vibe/[email protected]

Or with npm:

npm i @vibe/[email protected]

To update @vibe/icons:

yarn add @vibe/[email protected]

Or with npm:

npm i @vibe/[email protected]

@YossiSaadi YossiSaadi merged commit ef07e3c into master Jan 27, 2025
14 checks passed
@YossiSaadi YossiSaadi deleted the feat/yossi/menu-allow-updating-position-of-submenu-even-if-re-render-not-8222833258 branch January 27, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants